#!/bin/sh

declare APP_NAME=$1

if [ ! -n "${APP_NAME}" ]; then
  echo " APP_NAME is empty, exit."
  exit 0
else
  echo " APP_NAME is ${APP_NAME}, continue..."
fi

echo ""
echo "${APP_NAME} restart begin..."
#echo ""

# 定义一个工作目录
declare path=$(cd `dirname $0`; pwd)
echo "current path is  :" ${path} 

declare BASE_PATH=${path};
cd ${BASE_PATH}

# echo ""
${BASE_PATH}/shutdown.sh ${APP_NAME}
sleep 1
${BASE_PATH}/startup.sh ${APP_NAME}

echo ""
echo "${APP_NAME} restart end."
echo ""
